/*
*
==============================================================================
*  Name        : 
*  Part of     : Omen Game Engine
*  Description : 
*  Version     : 1.0
*
*  Copyright (c) 2013 Lauri Kortevaara.
* 
==============================================================================
*/

#ifndef Omen_MOUSE_EVENT_H
#define Omen_MOUSE_EVENT_H

#include "OmenConfig.h"
#include "OmenEvent.h"
#include "OmenDataTypes.h"

namespace Omen {

    class OMEN_API MouseEvent : public Event
    {
    public:
        static const BYTE Button_Left = 1;
        static const BYTE Button_Right = 2;
        static const BYTE Button_Middle = 4;

        typedef enum {
            ALL_BUTTONS_UP = 0,
            LEFT_DOWN = 1 << 0,
            MIDDLE_DOWN = 1 << 1,
            RIGHT_DOWN = 1 << 2
       } ButtonState;

        typedef struct MousePosition {
        public:
            MousePosition( int _x, int _y ): x(_x), y(_y) {};
            MousePosition operator=(const MousePosition& other) { x = other.x; y = other.y; return *this; }
            int x, y;
        };

    public:
        MouseEvent() : m_buttonStates(ALL_BUTTONS_UP), m_mousePosition(MousePosition(0,0)) { };
        virtual ~MouseEvent() {};

        BYTE buttonStates() const { return m_buttonStates; }
        MouseEvent::MousePosition mousePosition() const { return m_mousePosition; }

        // Engine private implementation
        void setButtonStates( BYTE states ) { m_buttonStates = states; }
        void setMousePosition( const MousePosition& pos ) { m_mousePosition = pos; }
    
    private:
        #pragma warning(disable:4251) // Disable warning about private member variable needs to have dll-interface to be used by clients of class 'this'
        BYTE     m_buttonStates;
        MousePosition   m_mousePosition;
        #pragma warning(default:4251)
        
    };

    class OMEN_API MouseWheelEvent : public Event
    {
    public:
        MouseWheelEvent() : m_mouseWheelDelta(0) { };
        virtual ~MouseWheelEvent(){};

        int wheelDelta() const { return m_mouseWheelDelta; }
        void setWheelDelta( int wheelDelta ) { m_mouseWheelDelta = wheelDelta; }

    private:
        #pragma warning(disable:4251) // Disable warning about private member variable needs to have dll-interface to be used by clients of class 'this'
        int m_mouseWheelDelta;
        #pragma warning(default:4251)
        
    };
} // Omen

#endif // Omen_MOUSE_EVENT_H
